package com.xc.hotelmgr.webapi.modules.op.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;

import com.xc.hotelmgr.webapi.modules.op.dao.TaskStatusDao;
import com.xc.hotelmgr.webapi.modules.op.entity.TaskStatusEntity;
import com.xc.hotelmgr.webapi.modules.op.service.TaskStatusService;


@Service("taskStatusService")
public class TaskStatusServiceImpl extends ServiceImpl<TaskStatusDao, TaskStatusEntity> implements TaskStatusService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TaskStatusEntity> page = this.page(
                new Query<TaskStatusEntity>().getPage(params),
                new QueryWrapper<TaskStatusEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils sqlQueryPage(Map<String, Object> params) {
        IPage<TaskStatusEntity> page = new Query<TaskStatusEntity>().getPage(params);
        String taskCode = (String)params.get("taskCode");
        String dtId = (String)params.get("dtId");
        String storId = (String)params.get("storId");
        List<TaskStatusEntity> list = baseMapper.sqlQueryPage(page,taskCode,dtId,storId);
        return new PageUtils(page,list);
    }

    @Override
    public Long taskCnt() {
        return baseMapper.taskCnt();
    }
}